#!/usr/bin/perl -w

use strict;

my @vars = qw(
	p0 p1 p2 p3 l0 l1 l2 l3 m0 m1 m2 m3
	s00 s01 s10 s11 s20 s21 s30 s31
	b00 b01 b10 b11 b20 b21 b30 b31
);

while (<>)
{
	if (my ($x) = /([01]{28})/)
	{
		my @v = split //, $x;
		my %val = ();
		for (my $i = 0; $i < 28; ++$i)
		{
			$val{$vars[$i]} = $v[$i];
		}

		for (my $i = 0; $i < 4; ++$i)
		{
			printf "PC %d: PART = %d, LA = %d, MA = %d, MSG = %d%d, LDR = %d%d\n",
				$i, $val{'p'.$i}, $val{'l'.$i}, $val{'m'.$i},
				$val{'s'.${i}.'1'}, $val{'s'.${i}.'0'},
				$val{'b'.${i}.'1'}, $val{'b'.${i}.'0'};
		}
		print "\n";
	}
}
